package com.hhkj.api.train.model.info.res;

import cn.hutool.core.bean.BeanUtil;
import com.hhkj.admin.question.model.res.QuestionRes;
import com.hhkj.api.train.common.utils.ApiQuestionCollectionConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * TrainContinuePractiseRes
 *
 * @author ZhengJun
 * @since 2023/5/27 17:46
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class ApiTrainContinuePractiseRes extends ApiTrainRes
{
    /** 练习模式 answer：答题模式；recitation： */
    private String practiceModeCode;

    /** 题目列表 */
    private List<ApiQuestionPractiseRes> questionList;

    public ApiTrainContinuePractiseRes(String trainKey, Integer effectiveMinute, String practiceModeCode, List<QuestionRes> questionGroupList)
    {
        super(trainKey, effectiveMinute);
        this.practiceModeCode = practiceModeCode;

        List<ApiQuestionRes> apiQuestionResList = ApiQuestionCollectionConverter.convertList(questionGroupList);
        this.questionList = BeanUtil.copyToList(apiQuestionResList, ApiQuestionPractiseRes.class);
    }
}
